from db_connect import ConnMysql

from db_connect import ConnMysqlSlave

from db_connect import ConnRedis

from sanic import Sanic

from . import app_apiorder

from sanic import response

from .method import Orders_insert

from db_connect.datetimes import DateEncoder

import asyncio

@app_apiorder.route('/order_info')
async def order_info(request) :

    info = request.args
    user_id = info.get('user_id')
    merchat_id = info.get('merchat_id')
    orders = info.get('orders')

    result_info = await Orders_insert().ord_ins(user_id, merchat_id, orders)

    return response.json(result_info, cls=DateEncoder)


